package com.jiangxue.common.entity;

/**
 * TFEntity
 *
 * @author: zhangteng
 * @time: 2014/11/29 17:46
 */
public class TFEntity {

    // 文档编号
    private int docNum;

    // 词
    private String keyWord;

    // tf值
    private Double tf;

    // 出现次数
    private int termCount;

    public TFEntity(int docNum, String keyWord, int termCount) {
        this.docNum = docNum;
        this.keyWord = keyWord;
        this.termCount = termCount;
    }

    public TFEntity(int docNum, String keyWord, int termCount, Double tf) {
        this.docNum = docNum;
        this.keyWord = keyWord;
        this.termCount = termCount;
        this.tf = tf;
    }

    public int getDocNum() {
        return docNum;
    }

    public void setDocNum(int docNum) {
        this.docNum = docNum;
    }

    public String getKeyWord() {
        return keyWord;
    }

    public void setKeyWord(String keyWord) {
        this.keyWord = keyWord;
    }

    public Double getTf() {
        return tf;
    }

    public void setTf(Double tf) {
        this.tf = tf;
    }

    public int getTermCount() {
        return termCount;
    }

    public void setTermCount(int termCount) {
        this.termCount = termCount;
    }

    @Override
    public String toString() {
        return docNum + "\t" + termCount + "\t" + keyWord;
    }

    public String toString1() {
        return docNum + "\t" + String.format("%.4f", tf) + "\t" + keyWord;
    }

    public String toString2() {
        return keyWord + "\t" + String.format("%.4f", tf) + "\t" + docNum;
    }
}
